using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using Clue_Less_Shared.Enumerations;

namespace Clue_Less_Shared
{
    /// <summary>
    /// Class representing game board
    /// </summary>
    public class Board
    {
        private List<BoardCell> cells = new List<BoardCell>();

        public BoardCell GetCell(short x, short y)
        {
            foreach (BoardCell cell in cells)
            {
                if (cell.XPosition == x &&
                    cell.YPosition == y)
                    return cell;
            }
            return null;
        }

        public Board()
        {
            // Initializing the board
            cells.Add(new BoardCell(Rooms.Study, 0, 0));
            cells.Add(new BoardCell(Rooms.Corridor, 0, 1));
            cells.Add(new BoardCell(Rooms.Hall, 0, 2));
            cells.Add(new BoardCell(Rooms.Corridor, 0, 3));
            cells.Add(new BoardCell(Rooms.Lounge, 0, 4));
            cells.Add(new BoardCell(Rooms.Corridor, 1, 0));
            cells.Add(new BoardCell(Rooms.Empty, 1, 1));
            cells.Add(new BoardCell(Rooms.Corridor, 1, 2));
            cells.Add(new BoardCell(Rooms.Empty, 1, 3));
            cells.Add(new BoardCell(Rooms.Corridor, 1, 4));
            cells.Add(new BoardCell(Rooms.Library, 2, 0));
            cells.Add(new BoardCell(Rooms.Corridor, 2, 1));
            cells.Add(new BoardCell(Rooms.BilliardRoom, 2, 2));
            cells.Add(new BoardCell(Rooms.Corridor, 2, 3));
            cells.Add(new BoardCell(Rooms.DiningRoom, 2, 4));
            cells.Add(new BoardCell(Rooms.Corridor, 3, 0));
            cells.Add(new BoardCell(Rooms.Empty, 3, 1));
            cells.Add(new BoardCell(Rooms.Corridor, 3, 2));
            cells.Add(new BoardCell(Rooms.Empty, 3, 3));
            cells.Add(new BoardCell(Rooms.Corridor, 3, 4));
            cells.Add(new BoardCell(Rooms.Conservatory, 4, 0));
            cells.Add(new BoardCell(Rooms.Corridor, 4, 1));
            cells.Add(new BoardCell(Rooms.Ballroom, 4, 2));
            cells.Add(new BoardCell(Rooms.Corridor, 4, 3));
            cells.Add(new BoardCell(Rooms.Kitchen, 4, 4));
        }

    }
}
